﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Data;
using System.Data.SqlClient;

namespace ArtsShop.DataLayer.DataAccess
{
    public class ProductDAO : DataServiceBase
    {
         public ProductDAO() : base() { }
        /// <summary>
        ///	Creates a new DataService and specifies a transaction with
        ///	which to operate
        /// </summary>
         public ProductDAO(IDbTransaction txn) : base(txn) { }
         
        public DataSet getProductsByCategory(int categoryId)
        {
            return ExecuteDataSet("getProductsByCategory", CreateParameter("@categoryId", SqlDbType.Int, categoryId));
        }


        public DataSet getProductById(int productId)
        {
            
            return ExecuteDataSet("getProductById", CreateParameter("@productId", SqlDbType.Int, productId));
        }
    }
}
